//
//  CGQfankuiViewController.swift
//  SheYangBigData
//
//  Created by 叁拾叁 on 2021/4/15.
//  Copyright © 2021 叁拾叁. All rights reserved.
//

import UIKit

class CGQfankuiViewController: SYBaseTableViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = UIColor(hex: 0xF7F7F7)
        
        let bgView: UIView = {
            let v = UIView()
            return v
        }()
        self.title = "反馈"
        let tipText: UILabel = {
            let v = UILabel()
            v.text = "反馈意见或建议"
            v.font = 15.autoBoldFontSize()
            v.textColor = UIColor(hex: 0x6F6F6F)
            return v
        }()
        
        let line: UIView = {
            let v = UIView()
            v.backgroundColor = UIColor(hex: 0xF5F8FC)
            return v
        }()
        let nameTf: EWTextView = {
            let v:EWTextView = EWTextView()
            v.textColor = UIColor(hex: 0x333333)
            v.font = 14.autoFontSize()
            v.textAlignment = .right
            v.placeHolder = "请输入您的意见或建议"
            v.textAlignment = .left
            return v
        }()
        let tixianBt: UIButton = {
            let v = UIButton()
            v.setTitle("提交", for: .normal)
            v.setTitleColor(.white, for: .normal)
            v.titleLabel?.font = 14.autoFontSize()
            v.backgroundColor = UIColor(hex: 0x0782FF)
            v.layer.cornerRadius = 3
            return v
        }()
        
        bgView.backgroundColor = .white
        self.view.addSubview(bgView)
        bgView.addSubview(tipText)
        bgView.addSubview(line)
        bgView.addSubview(nameTf)
        self.view.addSubview(tixianBt)
        bgView.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(NAV_HEIGHT+22.autoWidth())
            make.left.equalToSuperview().offset(autoWidth(0))
            make.right.equalToSuperview().offset(autoWidth(0))
            make.height.equalTo(autoWidth(300))

        }
        tipText.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(10.autoWidth())
            make.left.equalToSuperview().offset(autoWidth(20))
            make.right.equalToSuperview().offset(autoWidth(-20.0))
            make.height.equalTo(autoWidth(18))

        }
        line.snp.makeConstraints { (make) in
            make.top.equalTo(tipText.snp.bottom).offset(22.autoWidth())
            make.left.equalToSuperview().offset(autoWidth(20))
            make.right.equalToSuperview().offset(autoWidth(-20.0))
            make.height.equalTo(1)
        }
        nameTf.snp.makeConstraints { (make) in
            make.top.equalTo(line.snp.bottom).offset(10.autoWidth())
            make.left.equalToSuperview().offset(autoWidth(20))
            make.right.equalToSuperview().offset(autoWidth(-20))
            make.height.equalTo(200)
        }

        tixianBt.snp.makeConstraints { (make) in
            make.left.equalToSuperview().offset(autoWidth(20))
            make.right.equalToSuperview().offset(autoWidth(-15.0))
            make.height.equalTo(autoWidth(44))
            make.bottom.equalToSuperview().offset(autoWidth(-64))
        }

        
        tixianBt .addAction {[weak self] in
            if let `self` = self {
                
            
                self.requestVM.baseRequest(disposeBag: self.dispose, type: .xinjian(dic: ["content": nameTf.text ?? "" ]), modelClass: SGBaseModel<CGQshebeiinfoModel>.self) {[weak self] (res) in
                    
                    if let `self` = self  {
                        
                        self.popVC()
                        
                    }
                    
                } Error: {
                    
                }
                
                
            }
            
        }
        
        // Do any additional setup after loading the view.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
